package server.deploy;

import server.util.RequestUtil;

/*
过滤器映射对象,用于存储过滤器要拦截哪些路径或Servlet
*/
/*
2023/2/27 该类内容全部写完,后续直接使用,无需修改
by cyl
 */
public class FilterMap {
    //过滤器名
    private String filterName = null;
    //过滤器要过滤的Servlet名
    private String servletName = null;
    //过滤器要过滤的url匹配路径
    private String urlPattern = null;

    public String getFilterName() {
        return filterName;
    }

    public void setFilterName(String filterName) {
        this.filterName = filterName;
    }

    public String getServletName() {
        return servletName;
    }

    public void setServletName(String servletName) {
        this.servletName = servletName;
    }

    public String getUrlPattern() {
        return urlPattern;
    }

    public void setUrlPattern(String urlPattern) {
        this.urlPattern = RequestUtil.URLDecode(urlPattern);
    }

    public String toString() {
        StringBuffer sb = new StringBuffer("FilterMap[");
        sb.append("filterName=");
        sb.append(filterName);
        if (servletName != null) {
            sb.append(", servletName=");
            sb.append(servletName);
        }
        if (urlPattern != null) {
            sb.append(", urlPattern=");
            sb.append(urlPattern);
        }
        sb.append("]");
        return sb.toString();
    }
}
